.dh-switch {
    --dh-switch-on-color: var(--dh-color-primary);
    --dh-switch-off-color: var(--dh-border-color);
    --dh-switch-on-border-color: var(--dh-color-primary);
    --dh-switch-off-border-color: var(--dh-border-color);
  }
  
  .dh-switch {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    line-height: 20px;
    height: 32px;
    .dh-switch__input {
      position: absolute;
      width: 0;
      height: 0;
      opacity: 0;
      margin: 0;
      &:focus-visible {
        & ~ .dh-switch__core {
          outline: 2px solid var(--dh-switch-on-color);
          outline-offset: 1px;
        }
      }
    }
    &.is-disabled {
      opacity: .6;
      .dh-switch__core {
        cursor: not-allowed;
      }
    }
    &.is-checked {
      .dh-switch__core {
        border-color:var(--dh-switch-on-border-color);
        background-color: var(--dh-switch-on-color);
        .dh-switch__core-action {
          left: calc(100% - 17px);
        }
        .dh-switch__core-inner {
          padding: 0 18px 0 4px;
        }
      }
    }
  }
  .dh-switch--large {
    font-size: 14px;
    line-height: 24px;
    height: 40px;
    .dh-switch__core {
      min-width: 50px;
      height: 24px;
      border-radius: 12px;
      .dh-switch__core-action {
        width: 20px;
        height: 20px;
      }
    }
    &.is-checked {
      .dh-switch__core .dh-switch__core-action {
        left: calc(100% - 21px);
        color: var(--dh-switch-on-color);
      }
    }
  }
  .dh-switch--small {
    font-size: 12px;
    line-height: 16px;
    height: 24px;
    .dh-switch__core {
      min-width: 30px;
      height: 16px;
      border-radius: 8px;
      .dh-switch__core-action {
        width: 12px;
        height: 12px;
      }
    }
    &.is-checked {
      .dh-switch__core .dh-switch-core-action {
        left: calc(100% - 13px);
        color: var(--dh-switch-on-color);
      }
    }
  }
  .dh-switch__core {
    display: inline-flex;
    align-items: center;
    position: relative;
    height: 20px;
    min-width: 40px;
    border: 1px solid var(--dh-switch-off-border-color);
    outline: none;
    border-radius: 10px;
    box-sizing: border-box;
    background: var(--dh-switch-off-color);
    cursor: pointer;
    transition: border-color var(--dh-transition-duration),background-color var(--dh-transition-duration);
    .dh-switch__core-action {
      position: absolute;
      left: 1px;
      border-radius: var(--dh-border-radius-circle);
      width: 16px;
      height: 16px;
      background-color: var(--dh-color-white);
      transition: all var(--dh-transition-duration);
    }
    .dh-switch__core-inner {
      width: 100%;
      transition: all var(--dh-transition-duration);
      height: 16px;
      display: flex;
      justify-content: center;
      align-items: center;
      overflow: hidden;
      padding: 0 4px 0 18px;
      .dh-switch__core-inner-text {
        font-size: 12px;
        color: var(--dh-color-white);
        user-select: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }